﻿
#ifndef SLIDINGSIDEWINDOW_H
#define SLIDINGSIDEWINDOW_H

#include <QFrame>
#include <QPropertyAnimation>
#include <QAbstractAnimation>
#include <QParallelAnimationGroup>
#include <QPushButton>
#include "custombtn.h"


class SlidingSideWindow : public QFrame
{
    Q_OBJECT

public:
    SlidingSideWindow(QWidget *parent = nullptr);
    ~SlidingSideWindow();
protected:
    void enterEvent(QEvent *event) override;
    void leaveEvent(QEvent *event) override;
private:
    int m_widthHide;                //滑动侧边栏隐藏时宽度
    int m_widthShow;                //滑动侧边栏显示时宽度
    int m_widthChange;              //变化使用宽度
    int m_xShow;
    int m_xHide;
    int m_y;
    int m_customBtn_widthShow;
    int m_customBtn_widthHide;
    int m_customBtn_height;
    bool enterFlag;                 // 判断是否第一次进入
    QParallelAnimationGroup *animationGroup;//并行播放多个动画的动画组
    void initUI();
    void configInit();
    void animationGroupConfig();
    void anewRecordPos();            //重新记录位置
};

#endif // SLIDINGSIDEWINDOW_H
